<?php
// +----------------------------------------------------------------------
// | 作者: ZhangXuanNeng <rxthinkcmf@163.com>
// +----------------------------------------------------------------------

namespace app\admin\service;

use app\admin\model\DefaultConfig;

/**
 * 默认配置-服务类
 * @author ZhangXuanNeng
 * @since 2024/05/23
 * Class DefaultConfigService
 * @package app\admin\service
 */
class DefaultConfigService extends BaseService
{
    /**
     * 构造函数
     * @author ZhangXuanNeng
     * @since 2024/05/23
     * ConfigService constructor.
     */
    public function __construct()
    {
        $this->model = new DefaultConfig();
    }
    /**
     * 获取指定配置
     * @author ZhangXuanNeng
     * @since 2024/05/23
     */
    public function getDefaultConfig(){
        $param = request()->param();
        $row = $this->model->getDefaultConfig($param['name']);
        $message = array(
            "msg" => '操作成功',
            "code" => 0,
            "data" => $row,
        );
        return $message;
    }
    /**
     * 保存配置
     * @author ZhangXuanNeng
     * @since 2024/05/23
     */
    public function setDefaultConfig(){
        $param = request()->param();
        $row = $this->model->setDefaultConfig($param);
        $message = array(
            "msg" => '操作成功',
            "code" => 0,
            "data" => $row,
        );
        return $message;
    }
}